
#include <BReadWrite>
#include <BImage>
#include <BCursor>
#include <BPainter>

#include "SceneViewer.h"

SceneViewer::SceneViewer(BWidget* parent) : BViewer(parent)
{
	BImage* image = Read<BImage>("data/images/neon_008.png");
	BCursor* cursor = new BCursor(Cursor_Custom);
	cursor->setImage(image);
	cursor->setPoint(0, 0);
	cursor->setSize(60, 60);
	this->setCursor(cursor);
}
SceneViewer::~SceneViewer()
{

}

void SceneViewer::paintEvent(const BEvent& paintEvent)
{
	BPainter painter(this);
	painter.setColor(BColor(1, 1, 1) * 0.8f);
	painter.fillRect(0, 0, width(), height());
	painter.setColor(BColor(0, 0, 1));
	painter.drawRect(0, 0, width(), height());

	BViewer::paintEvent(paintEvent);
}

void SceneViewer::focusEvent(const BFocusEvent& focusEvent)
{
	this->raise();
}
